using System;
using System.ComponentModel.DataAnnotations;
using CPlatePrintSys.Domain.Enums;

namespace CPlatePrintSys.Domain.Models
{
    public class User
    {
        public int Id { get; set; }
        
        [Required]
        [StringLength(20, ErrorMessage = "用户名长度不能超过20个字符")]
        public string Username { get; set; }
        
        [Required]
        [StringLength(64, ErrorMessage = "密码长度不能超过20个字符")]
        public string Password { get; set; }
        
        [Required]
        [StringLength(20, ErrorMessage = "工号长度不能超过20个字符")]
        public string JobNumber { get; set; }

        [Required]
        [StringLength(100, ErrorMessage = "工号长度不能超过100个字符")]
        public string FullName { get; set; }
        
        public UserRole Role { get; set; } = UserRole.User;
        
        public bool IsActive { get; set; } = true;
        
        public DateTime CreatedAt { get; set; } = DateTime.Now;
        
        public DateTime UpdatedAt { get; set; } = DateTime.Now;
        
        public DateTime? LastLoginAt { get; set; }
    }
} 